<template>
  <div class="all">
    <el-card class="box-card">
      <span slot="header" class="title">信息验证</span>
      <el-form label-width="70px" style="width: 320px; margin: 20px auto">
        <el-form-item label="用户名">
          <el-input v-model="verify_form.name"></el-input>
        </el-form-item>
        <el-form-item label="手机号">
          <el-input v-model="verify_form.telephone"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" style="width: 115px" @click="next()"
            >下一步</el-button>

            <el-button style="width: 115px" @click="cancle()"
            >取 消</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template> 
<script>
export default {
  data() {
    return {
      verify_form: {
        name: "",
        telephone: "",
      },
      form1: {
        user_id: "",
      },
    };
  },
  methods: {
    next() {
      this.$axios
        .get("/verify", {
          params:{
            user_name: this.verify_form.name,
            user_telephone: this.verify_form.telephone,
          }
        })
        .then((res) => {
          if (res.data.status == "1001") {
            alert(res.data.messages);
          } else if (res.data.status == "1002") {
            alert("该账户已冻结，请联系管理员");
          } else if (res.data.status == "1003") {
            alert(res.data.messages);
          } else {
            this.form1 = res.data.data;
            sessionStorage.setItem("Id", this.form1.user_id);
            this.$router.push("/UpdatePassword");
          }
        });
    },

    cancle(){
      this.$router.push("/");
    }
  },
};
</script>

<style>
.all {
  border: 1px solid white;
  height: 700px;
  background-image: url("../assets/beijing.jpg");
  background-size: 100% 100%;
}
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
.title {
  text-align: center;
  font-size: 24px;
  color: rgba(50, 50, 50, 0.8);
}
.box-card {
  background-color: aliceblue;
  border-radius: 10px;
  width: 480px;
  margin: 10% auto;
}
</style>